// The Vue build version to load with the `import` command
// (runtime-only or standalone) has been set in webpack.base.conf with an alias.
import Vue from 'vue'
import App from './App'
import router from './router'
import Api from './api/index'
import iView from 'iview'
import axios from 'axios'
import VueWechatTitle from 'vue-wechat-title'
import { Message } from 'iview'
// import wScrollFix from 'wscrollfix/dist/wScrollFix'
import 'iview/dist/styles/iview.css'

Vue.config.productionTip = false
Vue.use(iView)
Vue.use(VueWechatTitle)
Vue.prototype.$api = Api
Vue.prototype.$axios = axios
Vue.prototype.$Message = Message

router.afterEach((to, from) => {
  if (to.meta.title) {
    document.title = to.meta.title
  }
})
/* eslint-disable no-new */
new Vue({
  el: '#app',
  router,
  axios,
  components: { App },
  template: '<App/>'
})
